package com.gzhryc.log.dao.db;

import java.util.Date;

import com.gzhryc.jdbc.annotaion.Column;
import com.gzhryc.jdbc.annotaion.Id;
import com.gzhryc.jdbc.annotaion.Table;
import com.gzhryc.log.enums.HttpLogEnum;
import com.gzhryc.log.models.IDateFragmentInfo;
import com.gzhryc.log.models.IHttpRequestInfo;

/**
 * HTTP链接记录
 * @author 张浩
 * @version 2016-9-29
 */
@Table(name="log_http_visit_record")
public class HttpVisitRecord implements IHttpRequestInfo,IDateFragmentInfo{

	@Id
	protected Long id;
	
	@Column(name="context_path")
	protected String contextPath;
	
	@Column(length=1024)
	protected String path;					//访问链接
	
	@Column(name="query_string",length=1024)
	protected String queryString;			//路径查询字符串
	
	@Column(name = "form_json", length = 1024)
	protected String formJson;			//form表单中数据
	
	@Column
	protected String method;				//访问方式
	
	@Column
	protected String lang;					//语言
	
	@Column
	protected String scheme;				//域名
	
	@Column
	protected String ip;					//访问IP
	
	@Column(name="is_xml_http_request")
	protected Boolean isXmlHttpRequest; 	//是否是XmlHttp访问
	
	@Column(length=1024)
	protected String accept;				//访问内容类型
	
	@Column(name="user_agent",length=1024)
	protected String userAgent;				//访问代理信息
	
	@Column(name="visit_software_name")
	protected String visitSoftwareName;		//访问的工具名称
	
	@Column(name="client_type",length=4)
	protected Integer clientType;			//客户端类型
	
	@Column(type="text")
	protected String referer;
	
	@Column
	protected Integer year;					//年
	
	@Column
	protected Integer month;				//月
	
	@Column
	protected Integer day;					//日
	
	@Column
	protected Integer hour;					//小时
	
	@Column
	protected Integer minute;				//分钟
	
	@Column(name="create_date")
	protected Date createDate;				//访问时间
	
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getContextPath() {
		return contextPath;
	}
	public void setContextPath(String contextPath) {
		this.contextPath = contextPath;
	}
	public String getPath() {
		return path;
	}
	public void setPath(String path) {
		this.path = path;
	}
	public String getLang() {
		return lang;
	}
	public void setLang(String lang) {
		this.lang = lang;
	}
	public String getMethod() {
		return method;
	}
	public void setMethod(String method) {
		this.method = method;
	}
	public String getIp() {
		return ip;
	}
	public void setIp(String ip) {
		this.ip = ip;
	}
	public Integer getClientType() {
		return clientType;
	}
	public void setClientType(Integer clientType) {
		this.clientType = clientType;
	}
	public Boolean getIsXmlHttpRequest() {
		return isXmlHttpRequest;
	}
	public void setIsXmlHttpRequest(Boolean isXmlHttpRequest) {
		this.isXmlHttpRequest = isXmlHttpRequest;
	}
	public String getAccept() {
		return accept;
	}
	public void setAccept(String accept) {
		this.accept = accept;
	}
	public String getUserAgent() {
		return userAgent;
	}
	public void setUserAgent(String userAgent) {
		this.userAgent = userAgent;
	}
	public String getReferer() {
		return referer;
	}
	public void setReferer(String referer) {
		this.referer = referer;
	}
	public Date getCreateDate() {
		return createDate;
	}
	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
	public Integer getYear() {
		return year;
	}
	public void setYear(Integer year) {
		this.year = year;
	}
	public Integer getMonth() {
		return month;
	}
	public void setMonth(Integer month) {
		this.month = month;
	}
	public Integer getDay() {
		return day;
	}
	public void setDay(Integer day) {
		this.day = day;
	}
	public Integer getHour() {
		return hour;
	}
	public void setHour(Integer hour) {
		this.hour = hour;
	}
	public Integer getMinute() {
		return minute;
	}
	public void setMinute(Integer minute) {
		this.minute = minute;
	}
	public String getVisitSoftwareName() {
		return visitSoftwareName;
	}
	public void setVisitSoftwareName(String visitSoftwareName) {
		this.visitSoftwareName = visitSoftwareName;
	}
	public String getScheme() {
		return scheme;
	}
	public void setScheme(String scheme) {
		this.scheme = scheme;
	}
	public String getQueryString() {
		return queryString;
	}
	public void setQueryString(String queryString) {
		this.queryString = queryString;
	}
	public String getFormJson() {
		return formJson;
	}
	public void setFormJson(String formJson) {
		this.formJson = formJson;
	}
	public String getClientTypeName(){
		return HttpLogEnum.ClientType.note(this.clientType);
	}
}
